<div class="container-fluid" id="app">
    <div class="side-body padding-top">
        <div class="row">
            <header>
                <h1>日志管理</h1>
            </header>
            <nav>
                <ul>
                    <li><a href="../html/index.html">返回首页</a></li>
                </ul>
            </nav>
            <div class="container">
                <table class="table">
                    <thead>
                        <tr>
                            <th>id</th>
                            <th>操作事件</th>
                            <th>操作时间</th>
                            <th>操作人</th>
                            <th>操作ip</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="log in logList" :key="log.id">
                            <td>{{ log.id }}</td>
                            <td>{{ log.content }}</td>
                            <td>{{ log.time }}</td>
                            <td>{{ log.operator }}</td>
                            <td>{{ log.ip }}</td>
                        </tr>
                    </tbody>
                </table>

                <!-- 分页 -->
                <div class="paging">
                    <nav aria-label="Page navigation example">
                        <ul class="pagination justify-content-end">
                            <li class="page-item" :class="{ disabled: currentPage === 1 }">
                                <a class="page-link" href="#" @click.prevent="getLogList(currentPage - 1)">上一页</a>
                            </li>
                            <li class="page-item" v-for="page in pageList" :key="page" :class="{ active: currentPage === page }">
                                <a class="page-link" href="#" @click.prevent="getLogList(page)">{{ page }}</a>
                            </li>
                            <li class="page-item" :class="{ disabled: currentPage === pageList.length }">
                                <a class="page-link" href="#" @click.prevent="getLogList(currentPage + 1)">下一页</a>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>